In optical computing, various optical devices are required for functions such as memory, logic, etc. To reach these goals, the semiconductor device research has focused on the optoelectronic switch with nonlinear optical response. Several devices, such as the p.sup.+ -n.sup.+ -p.sup.+ -n.sup.+ heterojunction bipolar phototransistors and the p-n-p-n double-heterostructure optoelectronic switches, have been developed for this purpose. In the characteristics of these devices, the avalanche multiplication in the reverse-biased region, and the hole confinement at the potential minimum are the causes for producing the negative differential resistance (NDR). However, the minority-carrier storage slows down the response speed of these devices. Furthermore, because the on-state current-voltage (I-V) characteristics of these devices are nearly independent of incident light, it is hard to reset them to the off-state optically unless a high resistance is connected, which is also harmful to high speed operation. Therefore, it is important to develop a switch which is free from minority-carrier storage and whose I-V characteristics can be controlled by the incident light power. For these purposes, the n.sup.+ -i-p.sup.+ -i-n.sup.+ triangular-barrier (TB) structure is one of the possible candidates. This device was first made by inserting a p.sup.+ -GaAs layer into an i-GaAs layer with n.sup.+ -GaAs layers on both sides. However, it is suitable for rectifying, not for switch application. To work a TB device as an optoelectronic switch, it is also necessary to introduce the avalanche multiplication and hole confinement into the device operation.